﻿using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace Lib.Tools.IO
{
    public class FileHelper
    {     /// <summary>
        /// 文件是否在指定大小内
        /// </summary>
        /// <param name="filePath">文件的路径</param>
        /// <param name="size">文件大小（MB）</param>
        /// <returns></returns>
        public static bool FileIsLessThan(string filePath, int size)
        {
            long defaultLen = size * 1024 * 1024;
            FileInfo file = new FileInfo(filePath);
            long len = file.Length;
            bool result = defaultLen >= len;

            return result;
        }
    }
}
